package it.unicam.fishpass.prism.parser;

/**
 * Initializes all of the declaration that are inside the project reset of all
 * the clock
 * 
 * @author Andrea Baiocco
 */
public class Declaration {

	final private String var;
	private float value;
	private float min;
	private float max;
	private Boolean bool;

	/**
	 * @param var
	 * @param value
	 */
	public Declaration(String var, float value) {
		this.var = var.toLowerCase();
		this.value = value;
	}

	/**
	 * @param var
	 * @param bool
	 */
	public Declaration(String var, Boolean bool) {
		this.var = var.toLowerCase();
		this.bool = bool;
	}

	/**
	 * @param var
	 * @param value
	 * @param min
	 * @param max
	 */
	public Declaration(String var, float value, float min, float max) {
		this.var = var.toLowerCase();
		this.value = value;
		this.min = min;
		this.max = max;
	}

	String getVar() {
		return var;
	}

	float getValue() {
		return value;
	}

	float getMin() {
		return min;
	}

	float getMax() {
		return max;
	}

	Boolean getBool() {
		return bool;
	}
	
	boolean isBool(){
		return bool != null;
	}

	boolean isRangeCorrect() {
		return (min < max) ? true : false;
	}

	@Override
	public String toString() {
		return "@Declaration [" + var + "  " + bool + "  " + min + "  " + max
				+ "  " + value + "]";

	}
}